<mat-card>Current Report</mat-card>
<mat-progress-spinner *ngIf="!isReportLoaded" mode="indeterminate"></mat-progress-spinner>
<div class="content" *ngIf="isReportLoaded">

  <mat-card>
    <div class="date-info">
    <mat-icon>calendar_today</mat-icon>
      <span class="info">Gathering financial information since {{currentReport.startDate}}</span>
    </div>
  </mat-card>
  <mat-expansion-panel>
    <mat-expansion-panel-header [collapsedHeight]="collapsedHeight"
                                [expandedHeight]="expandedHeight">
      <mat-panel-title>Expenses</mat-panel-title>
    </mat-expansion-panel-header>
    <mat-list>
      <mat-list-item *ngFor="let expense of currentReport.expenses">
        {{expense.expenseType}}
        <mat-icon>attach_money</mat-icon>
        <span>{{expense.amount | number : '1.2-2' | noCommaNumber}} PLN</span>
        <mat-divider></mat-divider>
      </mat-list-item>
    </mat-list>
  </mat-expansion-panel>

  <mat-expansion-panel>
    <mat-expansion-panel-header [collapsedHeight]="collapsedHeight"
                                [expandedHeight]="expandedHeight">
      <mat-panel-title>Income</mat-panel-title>
    </mat-expansion-panel-header>
    <mat-list>
      <mat-list-item *ngFor="let inc of currentReport.income">
        <mat-icon>attach_money</mat-icon>
        <span>{{inc | number : '1.2-2' | noCommaNumber}} PLN</span>
        <mat-divider></mat-divider>
      </mat-list-item>
    </mat-list>
  </mat-expansion-panel>

  <mat-expansion-panel>
    <mat-expansion-panel-header [collapsedHeight]="collapsedHeight"
                                [expandedHeight]="expandedHeight">
      <mat-panel-title>Figures expected for this report</mat-panel-title>
    </mat-expansion-panel-header>
    <mat-list>
      <mat-list-item>
        Income:
        <mat-icon>attach_money</mat-icon>
        <span>{{currentReport.estimatedCosts.estimatedIncome | number : '1.2-2' | noCommaNumber}} PLN</span>
      </mat-list-item>
      <mat-divider></mat-divider>
      <mat-list-item>
        Shipping costs:
        <mat-icon>attach_money</mat-icon>
        <span>{{currentReport.estimatedCosts.estimatedShippingCosts | number : '1.2-2' | noCommaNumber}} PLN</span>
      </mat-list-item>
      <mat-divider></mat-divider>
      <mat-list-item>
        Rent:
        <mat-icon>attach_money</mat-icon>
        <span>{{currentReport.estimatedCosts.rent | number : '1.2-2' | noCommaNumber}} PLN</span>
      </mat-list-item>
      <mat-divider></mat-divider>
      <mat-list-item>
        Salaries:
        <mat-icon>attach_money</mat-icon>
        <span>{{currentReport.estimatedCosts.salaries | number : '1.2-2' | noCommaNumber}} PLN</span>
      </mat-list-item>
      <mat-divider></mat-divider>
      <mat-list-item>
        Social fund:
        <mat-icon>attach_money</mat-icon>
        <span>{{currentReport.estimatedCosts.socialFund | number : '1.2-2' | noCommaNumber}} PLN</span>
      </mat-list-item>
      <mat-divider></mat-divider>
      <mat-list-item>
        Stock costs:
        <mat-icon>attach_money</mat-icon>
        <span>{{currentReport.estimatedCosts.stockCosts | number : '1.2-2' | noCommaNumber}} PLN</span>
      </mat-list-item>
      <mat-divider></mat-divider>
      <mat-list-item>
        Taxes:
        <mat-icon>attach_money</mat-icon>
        <span>{{currentReport.estimatedCosts.taxes | number : '1.2-2' | noCommaNumber}} PLN</span>
      </mat-list-item>
      <mat-divider></mat-divider>
      <mat-list-item>
        Unexpected expenses:
        <mat-icon>attach_money</mat-icon>
        <span>{{currentReport.estimatedCosts.unexpected | number : '1.2-2' | noCommaNumber}} PLN</span>
      </mat-list-item>
      <mat-divider></mat-divider>
    </mat-list>
  </mat-expansion-panel>

  <div class="button-group">
    <button mat-raised-button (click)="reestimate()" [disabled]="!areRecommendationsLoaded">Recalculate estimated figures</button>
    <button mat-raised-button (click)="addExpense()">Add expense</button>
    <button mat-raised-button (click)="addIncome()">Add income</button>
  </div>
</div>
